﻿<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.evolutility.com" title="日生产情况（按生产单）" icon="cube.gif" description="Customers">
  <data dbtable="MRP_DailyProduce" splogin="asp.net membership" dbcolumnpk="ID" sppaging="EvoSP_PagedItem @SQLselect, @SQLtable, @SQLfrom, @SQLwhere, @SQLorderby, @SQLpk, @pageid, @pagesize" />
  <panel userid="1" ppos="1" label="日生产任务单" width="100">
    <field id="1146" type="lov" typeid="5" label="产品名称" dbcolumn="ProductID" dbcolumnread="Name" dbcolumnreadlov="Name" dbwherelov="MRP_MaterialMain.MType=5" dbtablelov="MRP_MaterialMain" maxlength="2" readonly="0" required="1" optional="" fpos="20" search="1" searchadv="1" searchlist="1" height="1" width="20" />
    <field id="85" panelid="3" type="text" typeid="5" label="任务单号" dbcolumn="ProduceCode" dbcolumnread="ProduceCode" maxlength="12" readonly="1" required="1" optional="" fpos="10" search="1" searchadv="1" searchlist="1" height="1" width="18" />
    <field id="1153" type="formula" typeid="10" label="统计日期" dbcolumn="getdate()" dbcolumnread="ProduceDate" maxlength="4" readonly="0" required="1" optional="" fpos="30" search="1" searchadv="1" searchlist="1" height="1" width="20" />
    <field id="1247" type="integer" typeid="10" label="数量" dbcolumn="Quantity" dbcolumnread="Quantity" maxlength="6" readonly="0" required="1" optional="" fpos="30" search="1" searchadv="1" searchlist="1" height="1" width="12" />
    <field id="1348" type="integer" typeid="10" label="每筐数数量" dbcolumn="Batch" dbcolumnread="Batch" maxlength="6" readonly="0" required="1" optional="" fpos="30" search="1" searchadv="1" searchlist="1" height="1" width="12" />
    <field id="1471" type="formula" typeid="10" label="已完成筐数" dbcolumn="Select case when (SELECT Count(*) FROM MRP_DailyProduceBatch where MRP_DailyProduceBatch.DailyProduceID=T.ID and MRP_DailyProduceBatch.IsCompleted=1) is null then 0 else (SELECT Count(*) FROM MRP_DailyProduceBatch where MRP_DailyProduceBatch.DailyProduceID=T.ID and MRP_DailyProduceBatch.IsCompleted=1) end "
      dbcolumnread="C_ProduceQuantity" maxlength="5" readonly="1" required="0" optional="" fpos="30" search="0" searchadv="0" searchlist="1" height="1" width="10" />
    <field id="1434" type="lov" typeid="5" label="状态" dbcolumn="Status" dbcolumnread="DPStatus"
dbtablelov="View_Order_Status_List" dbcolumnreadlov="DisplayText" maxlength="0" readonly="1" required="0" optional="" fpos="30" search="0" searchadv="1" searchlist="1" height="1" width="10" />
  </panel>
  <panel-details panelid="2" userid="1" ppos="1" label="工艺流程定义" width="100" dborder="ProcessOrder" dbtabledetails="View_GetProcessByDailyProduce" dbcolumndetails="ProduceID">
    <field id="147" panelid="2" type="integer" typeid="10" label="工序顺序" dbcolumn="ProcessOrder" dbcolumnread="ProcessOrder" maxlength="2" readonly="0" required="1" optional="" fpos="30" search="1" searchadv="1" searchlist="1" height="1" width="10" />
    <field id="155" panelid="2" type="lov" typeid="5" label="工序名称" dbcolumn="Name" dbcolumnread="DisplayText"
   dbtablelov="View_ProcessName_List" dbcolumnreadlov="DisplayText" maxlength="0" readonly="0" required="1" optional="" fpos="30" search="0" searchadv="1" searchlist="0" height="1" width="10" />
    <field id="1471" panelid="2" type="formula" typeid="10" label="已经完成数量" dbcolumn="Select case when (SELECT SUM(ProduceQuantity) FROM View_Report_DailyProduceByProcess where View_Report_DailyProduceByProcess.ID=T.ProduceID and View_Report_DailyProduceByProcess.ProcessType=T.Name) is null then 0 else (SELECT SUM(ProduceQuantity) FROM View_Report_DailyProduceByProcess where View_Report_DailyProduceByProcess.ID=T.ProduceID and View_Report_DailyProduceByProcess.ProcessType=T.Name) end "
      dbcolumnread="C_ProduceQuantity" maxlength="5" readonly="1" required="0" optional="" fpos="30" search="0" searchadv="0" searchlist="1" height="1" width="10" />
    <field id="1472" panelid="2" type="formula" typeid="10" label="当日完成数量" dbcolumn="Select case when (SELECT SUM(ProduceQuantity) FROM View_Report_DailyProduceByProcess where View_Report_DailyProduceByProcess.ID=T.ProduceID and View_Report_DailyProduceByProcess.ProcessType=T.Name and datediff(day,ProduceDate,getdate())=0) is null then 0 else (SELECT SUM(ProduceQuantity) FROM View_Report_DailyProduceByProcess where View_Report_DailyProduceByProcess.ID=T.ProduceID and View_Report_DailyProduceByProcess.ProcessType=T.Name and datediff(day,ProduceDate,getdate())=0) end"
      dbcolumnread="ProduceQuantityT" maxlength="5" readonly="1" required="0" optional="" fpos="30" search="0" searchadv="0" searchlist="1" height="1" width="10" />
    <field id="1473" panelid="2" type="formula" typeid="10" label="当日不良数量" dbcolumn="Select case when (SELECT SUM(DefectiveQuantity) FROM View_Report_DailyProduceByProcess where View_Report_DailyProduceByProcess.ID=T.ProduceID and View_Report_DailyProduceByProcess.ProcessType=T.Name and datediff(day,ProduceDate,getdate())=0) is null then 0 else (SELECT SUM(DefectiveQuantity) FROM View_Report_DailyProduceByProcess where View_Report_DailyProduceByProcess.ID=T.ProduceID and View_Report_DailyProduceByProcess.ProcessType=T.Name and datediff(day,ProduceDate,getdate())=0) end"
      dbcolumnread="DefectiveQuantityT" maxlength="5" readonly="1" required="0" optional="" fpos="30" search="0" searchadv="0" searchlist="1" height="1" width="10" />
    <field id="1474" panelid="2" type="formula" typeid="10" label="当日返修数量" dbcolumn="Select case when (SELECT SUM(ReworkQuantity) FROM View_Report_DailyProduceByProcess where View_Report_DailyProduceByProcess.ID=T.ProduceID and View_Report_DailyProduceByProcess.ProcessType=T.Name and datediff(day,ProduceDate,getdate())=0) is null then 0 else (SELECT SUM(ReworkQuantity) FROM View_Report_DailyProduceByProcess where View_Report_DailyProduceByProcess.ID=T.ProduceID and View_Report_DailyProduceByProcess.ProcessType=T.Name and datediff(day,ProduceDate,getdate())=0) end"
      dbcolumnread="ReworkQuantityT" maxlength="5" readonly="1" required="0" optional="" fpos="30" search="0" searchadv="0" searchlist="1" height="1" width="10" />
    <field id="1475" panelid="2" type="formula" typeid="10" label="当日报废数量" dbcolumn="Select case when (SELECT SUM(RejectQuantity) FROM View_Report_DailyProduceByProcess where View_Report_DailyProduceByProcess.ID=T.ProduceID and View_Report_DailyProduceByProcess.ProcessType=T.Name and datediff(day,ProduceDate,getdate())=0) is null then 0 else (SELECT SUM(RejectQuantity) FROM View_Report_DailyProduceByProcess where View_Report_DailyProduceByProcess.ID=T.ProduceID and View_Report_DailyProduceByProcess.ProcessType=T.Name and datediff(day,ProduceDate,getdate())=0) end"
      dbcolumnread="RejectQuantityT" maxlength="5" readonly="1" required="0" optional="" fpos="30" search="0" searchadv="0" searchlist="1" height="1" width="10" />
  </panel-details>
  
</form>